<script lang="ts">
	import EditActivityDataModal from './modals/EditActivityDataModal.svelte';
	import EditCertificateDataModal from './modals/EditCertificateDataModal.svelte';
	import EditCharacterDataModal from './modals/EditCharacterDataModal.svelte';
	import EditEduLevelDataModal from './modals/EditEduLevelDataModal.svelte';
	import EditInnerResourceDataModal from './modals/EditInnerResourceDataModal.svelte';
	import EditInterviewSkillDataModal from './modals/EditInterviewSkillDataModal.svelte';
	import EditJobDataModal from './modals/EditJobDataModal.svelte';
	import EditKnowledgePointDataModal from './modals/EditKnowledgePointDataModal.svelte';
	import EditLearnStepDataModal from './modals/EditLearnStepDataModal.svelte';
	import EditMajorDataModal from './modals/EditMajorDataModal.svelte';
	import EditRelateRoadmapDataModal from './modals/EditRelateRoadmapDataModal.svelte';
	import EditSkillDataModal from './modals/EditSkillDataModal.svelte';
	import EditStudyResourceDataModal from './modals/EditStudyResourceDataModal.svelte';
	import { roadmapStore } from './store.svelte';
</script>

{#if roadmapStore.targetNodeType != null && roadmapStore.targetDropPosition != null}
	{#if roadmapStore.targetNodeType == 'JobData'}
		<EditJobDataModal />
	{:else if roadmapStore.targetNodeType == 'InterviewSkillData'}
		<EditInterviewSkillDataModal />
	{:else if roadmapStore.targetNodeType == 'SkillData'}
		<EditSkillDataModal />
	{:else if roadmapStore.targetNodeType == 'CertificateData'}
		<EditCertificateDataModal />
	{:else if roadmapStore.targetNodeType == 'ActivityData'}
		<EditActivityDataModal />
	{:else if roadmapStore.targetNodeType == 'InnerResourceData'}
		<EditInnerResourceDataModal />
	{:else if roadmapStore.targetNodeType == 'StudyResourceData'}
		<EditStudyResourceDataModal />
	{:else if roadmapStore.targetNodeType == 'LearnStepData'}
		<EditLearnStepDataModal />
	{:else if roadmapStore.targetNodeType == 'KnowledgePointData'}
		<EditKnowledgePointDataModal />
	{:else if roadmapStore.targetNodeType == 'CharacterData'}
		<EditCharacterDataModal />
	{:else if roadmapStore.targetNodeType == 'RelateRoadmapData'}
		<EditRelateRoadmapDataModal />
	{:else if roadmapStore.targetNodeType == 'EduLevelData'}
		<EditEduLevelDataModal/>
	{:else if roadmapStore.targetNodeType == 'MajorData'}
		<EditMajorDataModal />
	{/if}
{/if}

{#if roadmapStore.editNodeType != null && roadmapStore.editNode != null}
	{#if roadmapStore.editNodeType == 'JobData'}
		<EditJobDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'InterviewSkillData'}
		<EditInterviewSkillDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'SkillData'}
		<EditSkillDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'CertificateData'}
		<EditCertificateDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'ActivityData'}
		<EditActivityDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'InnerResourceData'}
		<EditInnerResourceDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'StudyResourceData'}
		<EditStudyResourceDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'LearnStepData'}
		<EditLearnStepDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'KnowledgePointData'}
		<EditKnowledgePointDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'CharacterData'}
		<EditCharacterDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'RelateRoadmapData'}
		<EditRelateRoadmapDataModal node={roadmapStore.editNode} />
	{:else if roadmapStore.editNodeType == 'EduLevelData'}
		<EditEduLevelDataModal node={roadmapStore.editNode}/>
	{:else if roadmapStore.editNodeType == 'MajorData'}
		<EditMajorDataModal node={roadmapStore.editNode}/>
	{/if}
{/if}
